From 8119b4ce0c4478e1ad403db35e2f7b74b0b5dfce Mon Sep 17 00:00:00 2001 From: Eddie Dong Date: Thu, 9 Jun 2011 16:24:09 +0800 Subject: [PATCH] Nested VMX: Add VMXE bits in virtual CR4 Signed-off-by: Qing He Signed-off-by: Eddie Dong Signed-off-by: Tim Deegan Committed-by: Tim Deegan --- xen/include/asm-x86/cpufeature.h | 2 ++ xen/include/asm-x86/hvm/hvm.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h index 3e6d4c5c80..fa7dd45191 100644 --- a/xen/include/asm-x86/cpufeature.h +++ b/xen/include/asm-x86/cpufeature.h @@ -222,6 +222,8 @@ #define cpu_has_svm boot_cpu_has(X86_FEATURE_SVM) +#define cpu_has_vmx boot_cpu_has(X86_FEATURE_VMXE) + #endif /* __ASM_I386_CPUFEATURE_H */ /* diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index 70e79978bc..527edcb5d3 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -325,6 +325,8 @@ static inline int hvm_do_pmu_interrupt(struct cpu_user_regs *regs) X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE | \ X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT | \ (cpu_has_smep ? X86_CR4_SMEP : 0) | \ + ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\ + ? X86_CR4_VMXE : 0) | \ (xsave_enabled(_v) ? X86_CR4_OSXSAVE : 0)))) /* These exceptions must always be intercepted. */ -- 2.30.2